﻿@{
    try
    {
        if ((HttpContext.Current.Session["PersonId"] == null) && (int.Parse(HttpContext.Current.Session["PersonId"].ToString()) == 0))
        {
            ViewBag.NameLinkOfLoginPage = "Войти";
        }
        else
        {
            ViewBag.NameLinkOfLoginPage = "Выйти";
        }
    }
    catch { ViewBag.NameLinkOfLoginPage = "Войти"; }

    ViewBag.LinkToMisis = GlobalSettings.LinkToMisis;

    ViewBag.ViewOfHomePage = GlobalSettings.ViewOfHomePage;
    ViewBag.ControllerOfHomePage = GlobalSettings.ControllerOfHomePage;


    ViewBag.NameLinkOfRegistrationPage = GlobalSettings.NameLinkOfRegistrationPage;
    ViewBag.ViewOfRegistrationPage = GlobalSettings.ViewOfRegistrationPage;
    ViewBag.ControllerOfRegistrationPage = GlobalSettings.ControllerOfRegistrationPage;

    ViewBag.ViewOfLoginPage = GlobalSettings.ViewOfLoginPage;
    ViewBag.ControllerOfLoginPage = GlobalSettings.ControllerOfLoginPage;

    ViewBag.NameLinkOfPersonalPage = GlobalSettings.NameLinkOfPersonalPage;

    ViewBag.ViewOfPersonalPage = GlobalSettings.ViewOfPersonalPage;
    ViewBag.ControllerOfPersonalPage = GlobalSettings.ControllerOfPersonalPage;

    ViewBag.ViewOfTariffs = GlobalSettings.ViewOfTariffs;
    ViewBag.ControllerOfTariffs = GlobalSettings.ControllerOfTariffs;
    ViewBag.NameLinkOfTariffs = GlobalSettings.NameLinkOfTariffs;

}

<nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="@ViewBag.LinkToMisis" target="_blank">MISiS</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li>
                    @Html.ActionLink(
                   "Главная",
                    (string)ViewBag.ViewOfHomePage,
                    (string)ViewBag.ControllerOfHomePage,
                    null,
                    new { target = "_self" })
                </li>
                <li>
                    @Html.ActionLink(
                        (string)ViewBag.NameLinkOfPersonalPage,
                        (string)ViewBag.ViewOfPersonalPage,
                        (string)ViewBag.ControllerOfPersonalPage,
                        null,
                        new { target = "_self" })
                </li>
                <li class="dropdown">
                    <a href="" class="dropdown-toggle" data-toggle="dropdown">Информация<b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li>
                            @Html.ActionLink(
                           "Перечень корпусов",
                           "Dorms",
                           "Info",
                           null,
                           new { target = "_self" })
                        </li>
                        <li>
                            @Html.ActionLink(
                           (string)ViewBag.NameLinkOfTariffs,
                           (string)ViewBag.ViewOfTariffs,
                           (string)ViewBag.ControllerOfTariffs,
                           new
                           {
                               Page = 1
                           },
                        new { target = " _self" })
                        </li>
                    </ul>
                </li>
            </ul>

            <ul class="nav navbar-nav navbar-right">
                <li>
                    @Html.ActionLink(
                    (string)ViewBag.NameLinkOfRegistrationPage,
                    (string)ViewBag.ViewOfRegistrationPage,
                    (string)ViewBag.ControllerOfRegistrationPage,
                    null,
                    new { target = "_self" })
                </li>
                <li>
                    @Html.ActionLink(
                    (string)ViewBag.NameLinkOfLoginPage,
                    (string)ViewBag.ViewOfLoginPage,
                    (string)ViewBag.ControllerOfLoginPage,
                    null,
                    new { target = "_self" })
                </li>
                <li>
                    <a href="#modalDev"
                       id="btnShowDevModal" role="button" class="btn" data-toggle="modal"
                       data-target="#modalDev" style="text-align: left">Разработчик</a>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

<!-- Modal -->
<div class="modal fade" id="modalDev" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Разработчик</h4>
            </div>
            <div class="modal-body">
                <h5>Коротаева Виктория</h5>
                <hr style="width: 20%; margin-left:0; margin-top:0" />
                <p>Студентка кафедры ИК МИСиСа</p>
                <p>Направление: Прикладная математика</p>
                <p>Годы обучения: 2014 - 2018</p>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>

            </div>
        </div>
    </div>
</div>